<div id="news">

<?php if (isset($articlelist)) {
	if(!isset($articletitle)) { ?> <h2>News</h2> <? }else{ ?>
	
	<h2> <?= $articletitle ?> </h2> <?php } 
	foreach($articlelist as $article):?>
	
	<div id="article-<?= $article['article_id']; ?>" class="article">
	<table class="title-article">
	<tr>
	<td style="width: 100%;">
	<div><?= $article['title'];?></div>
	</td>
	<?php if ($this->auth->has_rights_to("edit","article",$article['article_id'])): ?>
	<td>
	<img class="action" title="Edit this news" style="cursor: pointer;" onclick="update_content('<?php echo site_url("article/edit/".$article['article_id']); ?>')" alt="Edit news" src="<?= base_url();?>img/edit.png" />
	</td>
	<?php endif; ?>
	<?php if ($this->auth->has_rights_to("delete","article",$article['article_id'])): ?>
	<td>
	<img class="action" title="Delete this news" style="cursor: pointer;" onclick="deleteArticle(<?= $article['article_id']; ?>);" alt="Delete News" src="<?= base_url();?>img/delete.png" />
	</td>
	<?php endif; ?>
	</tr>
	</table>
	<?php if($short==false){ ?>
		<div class="extended">
		<div class="content-article" ><?= $article['content'];?></div>
		<div class="footer-article" >by <?= $article['nickname'];?> on <?= $article['publication_date'];?></div>
		</div>
	<?php } ?>
	</div>
	
	<?php endforeach;
	echo $pagination;
}?>

</div>